package gitdemo1.git3.day01;

public class TestThtow {
    public static void function() throws NumberFormatException{
        String s = "abc";
        System.out.println(Double.parseDouble(s));
    }

    public static void main(String[] args) {
        try{
            function();
        }catch (Exception e){
            e.printStackTrace();
            e.getMessage();
        }
//        IllegalArgumentException


//        try {
//            function();
//        } catch (NumberFormatException e) {
//            System.err.println("非数据类型不能强制类型转换。");
//e.printStackTrace();
//        }
    }
}
